<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>星空表白墙</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <style>
        :root {
            --primary-color: #ff6b6b;
            --secondary-color: #ff9f43;
            --glass-color: rgba(255, 255, 255, 0.9);
            --text-color: #2d3436;
            --border-radius: 15px;
            --spacing: 2rem;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'MiSans', 'Segoe UI', sans-serif;
            min-height: 100vh;
            background: linear-gradient(45deg, #ffd3d3, #ffe8e8, #fff3f3);
            position: relative;
            overflow-x: hidden;
        }

        /* 星空背景动画 */
        .stars {
            position: fixed;
            width: 100vw;
            height: 100vh;
            pointer-events: none;
            z-index: 0;
        }

        .container {
            max-width: 800px;
            margin: 0 auto;
            background: var(--glass-color);
            backdrop-filter: blur(20px);
            border-radius: var(--border-radius);
            padding: var(--spacing);
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
            position: relative;
            z-index: 1;
            border: 1px solid rgba(255, 255, 255, 0.3);
            transform: translateY(0);
            transition: transform 0.5s ease;
        }

        .container:hover {
            transform: translateY(-10px);
        }

        .header {
            text-align: center;
            margin-bottom: 3rem;
            position: relative;
        }

        .title {
            color: var(--primary-color);
            font-size: 3.5rem;
            font-weight: 700;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
            margin-bottom: 1.5rem;
        }

        .title::after {
            content: '✨';
            position: absolute;
            animation: twinkle 1.5s infinite;
        }

        .form {
            display: grid;
            gap: 2rem;
            margin-bottom: 3rem;
        }

        .form-group {
            display: grid;
            grid-template-columns: 100px 1fr;
            align-items: center;
            gap: 1.5rem;
        }

        .form-label {
            font-size: 1.2rem;
            color: var(--text-color);
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .form-input {
            padding: 1rem;
            border: 2px solid rgba(255, 107, 107, 0.3);
            border-radius: var(--border-radius);
            font-size: 1.1rem;
            transition: all 0.3s ease;
            background: rgba(255, 255, 255, 0.8);
        }

        .form-input:focus {
            border-color: var(--primary-color);
            box-shadow: 0 0 20px rgba(255, 107, 107, 0.2);
        }

        .submit-btn {
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            color: white;
            padding: 1.5rem;
            border: none;
            border-radius: var(--border-radius);
            font-size: 1.3rem;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.8rem;
            position: relative;
            overflow: hidden;
        }

        .submit-btn::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
            transform: rotate(45deg);
            animation: shine 3s infinite;
        }

        .submit-btn:hover {
            transform: scale(1.05);
            box-shadow: 0 10px 30px rgba(255, 107, 107, 0.3);
        }

        .message-list {
            display: grid;
            gap: 1.5rem;
        }

        .message-item {
            background: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(255,245,245,0.9));
            padding: 2rem;
            border-radius: var(--border-radius);
            box-shadow: 0 5px 15px rgba(0,0,0,0.05);
            position: relative;
            overflow: hidden;
            transition: transform 0.3s ease;
        }

        .message-item:hover {
            transform: translateX(10px);
        }

        .message-item::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            height: 100%;
            width: 4px;
            background: var(--primary-color);
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @keyframes twinkle {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.3; }
        }

        @keyframes shine {
            0% { transform: translateX(-100%) rotate(45deg); }
            100% { transform: translateX(100%) rotate(45deg); }
        }

        /* 爱心装饰 */
        .heart-decoration {
            position: fixed;
            pointer-events: none;
            animation: float 3s infinite;
        }

        @keyframes float {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-20px); }
        }
    </style>
</head>
<body>
    <div class="stars"></div>
    
    <div class="container">
        <header class="header">
            <h1 class="title">💫 星空告白墙</h1>
            <p style="font-size: 1.2rem; color: #666;">让每一份心意都闪耀星空...</p>
        </header>
        
        <form class="form" id="confessionForm">
            <div class="form-group">
                <label class="form-label"><i class="fas fa-user"></i>告白者</label>
                <input type="text" class="form-input" placeholder="你的名字" required>
            </div>
            <div class="form-group">
                <label class="form-label"><i class="fas fa-heart"></i>告白对象</label>
                <input type="text" class="form-input" placeholder="TA的名字" required>
            </div>
            <div class="form-group">
                <label class="form-label"><i class="fas fa-comment"></i>告白内容</label>
                <input type="text" class="form-input" placeholder="说出你的心意..." required>
            </div>
            <button type="submit" class="submit-btn">
                <i class="fas fa-paper-plane"></i>
                发送告白
            </button>
        </form>

        <div class="message-list" id="messageList"></div>
    </div>

    <script>
        const form = document.getElementById('confessionForm');
        const messageList = document.getElementById('messageList');
        const starsContainer = document.querySelector('.stars');

        // 创建星空背景
        function createStars() {
            for (let i = 0; i < 100; i++) {
                const star = document.createElement('div');
                star.style.position = 'absolute';
                star.style.left = Math.random() * 100 + '%';
                star.style.top = Math.random() * 100 + '%';
                star.style.width = Math.random() * 3 + 'px';
                star.style.height = star.style.width;
                star.style.backgroundColor = '#fff';
                star.style.borderRadius = '50%';
                star.style.animation = `twinkle ${2 + Math.random() * 3}s infinite`;
                starsContainer.appendChild(star);
            }
        }

        form.addEventListener('submit', (e) => {
            e.preventDefault();
            
            const inputs = Array.from(form.querySelectorAll('.form-input'));
            const [from, to, message] = inputs.map(input => input.value.trim());
            
            if (!from || !to || !message) {
                alert('请填写完整信息哦～✨');
                return;
            }

            // 创建消息卡片
            const messageItem = document.createElement('div');
            messageItem.className = 'message-item';
            messageItem.innerHTML = `
                <div style="font-size: 1.3rem; margin-bottom: 1rem;">
                    <i class="fas fa-star" style="color: var(--primary-color);"></i>
                    <strong>${from}</strong> 对 <strong>${to}</strong> 说：
                </div>
                <p style="font-size: 1.2rem; line-height: 1.6;">"${message}"</p>
            `;

            // 添加动画
            messageItem.style.animation = 'fadeIn 0.8s cubic-bezier(0.22, 0.61, 0.36, 1)';
            messageList.prepend(messageItem);

            // 清空表单
            form.reset();

            // 添加爱心特效
            createHeartEffect(e.pageX, e.pageY);
        });

        // 创建爱心特效
        function createHeartEffect(x, y) {
            const heart = document.createElement('div');
            heart.className = 'heart-decoration';
            heart.innerHTML = '❤️';
            heart.style.left = x + 'px';
            heart.style.top = y + 'px';
            heart.style.fontSize = '24px';
            document.body.appendChild(heart);
            
            setTimeout(() => {
                heart.remove();
            }, 1000);
        }

        // 初始化星空
        createStars();
    </script>
</body>
</html>